Skip to content

Fix for memory leak2#72

Closed
NathanaelA wants to merge 3 commits into
NativeScript:masterfrom
NathanaelA:Fix_For_Memory_Leak2
Closed

Fix for memory leak2#72
NathanaelA wants to merge 3 commits into
NativeScript:masterfrom
NathanaelA:Fix_For_Memory_Leak2

Conversation

@NathanaelA

Copy link
Copy Markdown
Contributor

JNI apparently caches stuff in a local reference table; it can only supports 512 items. Adding the DeleteLocalRef will eliminate the obj's in the Local Reference Table so the Table doesn't overflow. Once the table overflows the application crashes.

Nathanael Anderson added 3 commits May 22, 2015 02:53
…upports 512 items. Doing some work in a loop that references a several variables can cause this table to exceed and then the app will crash with the following error: JNI ERROR (app bug): local reference table overflow (max=512) JNI local reference table (0xb9987968) dump: Failed adding to JNI local ref table (has 512 entries)
@ns-bot

ns-bot commented May 24, 2015

Copy link
Copy Markdown

Can one of the admins verify this patch?

@benchik

benchik commented May 28, 2015

Copy link
Copy Markdown

I'm having the same problem. I hope this fix will be included soon.

slavchev pushed a commit that referenced this pull request May 29, 2015
@slavchev

Copy link
Copy Markdown

@NathanaelA Thank you for reporting this issue. I reviewed your commits and wrapped the references into JniLocalRef stack allocated instances. I will add tests as well.

slavchev pushed a commit that referenced this pull request Jun 1, 2015
@slavchev slavchev modified the milestones: 1.1.0, 1.2.0 Jun 10, 2015
@Plamen5kov
Plamen5kov force-pushed the master branch 5 times, most recently from dc2cf97 to 5031087 Compare July 20, 2015 09:51
@blagoev blagoev modified the milestones: 1.3.0, 1.2.0 Jul 22, 2015
@atanasovg

Copy link
Copy Markdown
Contributor

quoting @slavchev:

I reviewed your commits and wrapped the references into JniLocalRef stack allocated instances.

The leaks are already fixed, closing.

@atanasovg atanasovg closed this Sep 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants